$(function () {
    initTime('beginCreateTime','endCreateTime','');
    initTime('beginPayTime','endPayTime','');
    $("body").on('click','#btn1,#btn2',function () {
        findOrderData(1);
    });

    findOrderData(1);
    //加载课程数据
    function findOrderData(page) {
        var params = $("#search-form").serializeJSON();
        if(typeSpread==1){
            params.spread =1;
        }
        params = JSON.stringify(params);
        var obj = {
            url: baseloaction + '/admin/order/ajaxQueryOrderList',//请求URL
            contextId: 'order-list-content',//响应内容页面设置内容ID
            params: params,//请求参数
            pageNo: page,//页码
            pageCall: findOrderData, //分页回调加载数据(点击上下页时调用,该方法也在加载页面完成时调用)
            callback: function () {//数据加载完成回调
                $("#count").html('（共'+total+'个订单）');
            }
        };
        ajaxGetListData(obj);
    }


    $('body').on('click','#downloadExcel',function(){
        var  url  ='/admin/order/downloadExcelOrdersList';
        if(typeSpread==1){
            url+="?spread=1";
        }
        exportExecl.init({
            title:"全部订单数据导出",
            excelUrl: url,
            type:1
         }
        )
    });

});